﻿@page "/ClipboardTest"
@inject IJSRuntime jsRuntime

<Button Text="Get Clipboard Content" OnClick="ButtonClick" />
<p>@clipboardContent</p>
@code {
    private string clipboardContent = "";

    protected override async Task OnInitializedAsync()
    {
        await jsRuntime.InvokeVoidAsync("import", "./clipboard.js");
        await base.OnInitializedAsync();
    }

    public async Task ButtonClick()
    {
        clipboardContent = await jsRuntime.InvokeAsync<string>("getClipboardText");
    }
}
